<?php
// *** Tangra (Application Framework and Tools for PHP)
// $Id$
//

require_once(TANGRA_MAIN_DIR.'core/debug.inc.php');
require_once(TANGRA_MAIN_DIR.'core/config_loader_file.class.php');

$conf_loader = new Config_Loader_File($PATHS->get_hidden().'conf/'.TANGRA_MACHINE_SPECIFIC_CONF_FILENAME);

load_error_reporting($conf_loader);

error_reporting($conf_loader->get_conf_value('ERROR_REPORTING'));
set_error_handler('tangra_error_handler');

// this function is only used to export as global variables $ERROR_REPRTING*
function load_error_reporting(Config_Loader_File $conf_loader) {
	global $ERROR_REPORTING;
	global $ERROR_REPORTING_PHP4_LIBS;

	$ERROR_REPORTING = $conf_loader->get_conf_value('ERROR_REPORTING');
	tangra_if_not_int_throw_e($ERROR_REPORTING);
	define('SYSTEM_ERROR_REPORTING', $ERROR_REPORTING);

	$ERROR_REPORTING_PHP4_LIBS = $conf_loader->get_conf_value('ERROR_REPORTING_PHP4_LIBS');
	tangra_if_not_int_throw_e($ERROR_REPORTING_PHP4_LIBS);
	define('SYSTEM_ERROR_REPORTING_PHP4_LIBS', $ERROR_REPORTING_PHP4_LIBS);
}
